import Vue from 'vue'
import Vuex from 'vuex'
import getters from './getters'
import app from './modules/app'
import settings from './modules/settings'
import user from './modules/user'
import tagsView from './modules/tagsView' // 新增
import goods from './modules/goods'
import shops from './modules/shops'
import server from './modules/server'
import orderGoods from "./modules/orderGoods";
import orderServices from "./modules/orderServices";
Vue.use(Vuex)

const store = new Vuex.Store({
  modules: {
    app,
    settings,
    user,
    tagsView,
    goods,
    shops,
    server, // 新增
    orderGoods,
    orderServices, 
  },
  getters,
  state: {
    userInfo: {}, // 存储用户的信息
    isAddRouter: false, // 是否动态的添加过路由
    asyncRoutes: [] // 动态的路由表
  },
  actions: {},
  mutations: {
    // 公共方法
    update(state, obj) {
      let { name, value } = obj;
      state[name] = value;
    }
  }
})

export default store
